<script setup lang='ts'>
// props标注类型

type Props = {
    color: string,
    size?: string,
    btnType?: 'success'|'warning'|'danger'
} 

// const props = defineProps<Props>()


// console.log(props.color)
// console.log(props.size)

// 为props设置默认值
const props = withDefaults(defineProps<Props>(),{
  size: 'middle',
  btnType: 'success'
})
console.log(props.color)
console.log(props.size)
console.log(props.btnType)

// 练习

</script>
<template>
<div>
  hello vue
</div>
</template>
<style scoped>
</style>